################################################################################
# emu-procsi makefile
################################################################################

RM := rm -rf

# All of the sources participating in the build are defined here
C_SRCS += \
./src/assembler.c \
./src/errors.c \
./src/instructions.c \
./src/main.c \
./src/memory.c \
./src/processor.c 

OBJS += \
./bin/src/assembler.o \
./bin/src/errors.o \
./bin/src/instructions.o \
./bin/src/main.o \
./bin/src/memory.o \
./bin/src/processor.o 

C_DEPS += \
./bin/src/assembler.d \
./bin/src/errors.d \
./bin/src/instructions.d \
./bin/src/main.d \
./bin/src/memory.d \
./bin/src/processor.d 


# Each subdirectory must supply rules for building sources it contributes
bin/src/%.o: ./src/%.c
	@echo 'Building file: $<'
	@echo 'Invoking: Cross GCC Compiler'
	gcc -I./include/ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
	@echo 'Finished building: $<'
	@echo ' '

# All Target
all: emu-procsi

mkdir:
	-mkdir bin
	-mkdir bin/src

# Tool invocations
emu-procsi: mkdir $(OBJS) $(USER_OBJS)
	@echo 'Building target: $@'
	@echo 'Invoking: Cross GCC Linker'
	gcc  -o "bin/emu-procsi" $(OBJS) $(USER_OBJS) $(LIBS)
	@echo 'Finished building target: $@'
	@echo ' '

# Other Targets
clean:
	-$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) emu-procsi
	-@echo ' '
